﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;
using MouseKeyboardActivityMonitor;
using MouseKeyboardActivityMonitor.WinApi;

namespace NewStart
{
    class MouseHelper
    {
        public static event MouseEventHandler MouseClick;
        public static bool Enabled { get { return mouse.Enabled; } set { mouse.Enabled = value; } }
        private static MouseHookListener mouse;

        public static void Initialize(Control control)
        {
            mouse = new MouseHookListener(new GlobalHooker());

            Enabled = false;
            mouse.MouseClick += mouse_MouseClick;
        }

        static void mouse_MouseClick(object sender, MouseEventArgs e)
        {
            MouseClick(sender, e);
        }

        public static void Dispose()
        {
            mouse.Dispose();
        }
    }
}
